<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xf="http://www.w3.org/2002/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      lang="de">
    <head>
        <title>Select1</title>

        <style type="text/css">
            .xfFullSelect1 {
                height:70px;
            }

            .xfGroupLabel {
                font-size: 12pt;
                font-weight: bold;
                padding-bottom: 10px;
            }

            #mips {
                diplay: block;
            }

            #mips .xfTrigger .dijitButtonContents {
                width: 200px;
            }

            /*#control2{display:block;}*/
            #control2 .xfSelectorItem .xfLabel {
                width: 20px;
            }
        </style>

    </head>
    <body class="tundra" style="overflow:hidden;padding:50px;">
        <div id="xforms">
            <div style="display:none;">
                <xf:model id="model-1">
                    <xf:instance id="instance-1" xmlns="">
                        <data constraint="true" readonly="false" required="false" relevant="true">
                            <items>
                                <item>AX</item>
                                <item>AL</item>
                                <item>AQ</item>
                                <item>l</item>
                            </items>
                        </data>
                    </xf:instance>

                    <xf:bind nodeset="items">
                        <xf:bind nodeset="item[1]"
                                 constraint="boolean-from-string(../../@constraint)"
                                 readonly="boolean-from-string(../../@readonly)"
                                 required="boolean-from-string(../../@required)"
                                 relevant="boolean-from-string(../../@relevant)"/>

                        <xf:bind nodeset="item[2]"
                                 constraint="boolean-from-string(../../@constraint)"
                                 readonly="boolean-from-string(../../@readonly)"
                                 required="boolean-from-string(../../@required)"
                                 relevant="boolean-from-string(../../@relevant)"/>

                        <xf:bind nodeset="item[3]"
                                 constraint="boolean-from-string(../../@constraint)"
                                 readonly="boolean-from-string(../../@readonly)"
                                 required="boolean-from-string(../../@required)"
                                 relevant="boolean-from-string(../../@relevant)"/>

                        <xf:bind nodeset="item[4]"
                                 constraint="boolean-from-string(../../@constraint)"
                                 readonly="boolean-from-string(../../@readonly)"
                                 required="boolean-from-string(../../@required)"
                                 relevant="boolean-from-string(../../@relevant)"/>
                    </xf:bind>

                    <xf:instance id="codes" xmlns="">
                        <countrylist lang="en">
                            <country>
                                <country-name>AFGHANISTAN</country-name>
                                <code>AF</code>
                            </country>
                            <country>
                                <country-name>LAND ISLANDS</country-name>
                                <code>AX</code>
                            </country>
                            <country>
                                <country-name>ALBANIA</country-name>
                                <code>AL</code>
                            </country>
                            <country>
                                <country-name>ALGERIA</country-name>
                                <code>DZ</code>
                            </country>
                            <country>
                                <country-name>AMERICAN SAMOA</country-name>
                                <code>AS</code>
                            </country>
                            <country>
                                <country-name>ANDORRA</country-name>
                                <code>AD</code>
                            </country>
                            <country>
                                <country-name>ANGOLA</country-name>
                                <code>AO</code>
                            </country>
                            <country>
                                <country-name>ANGUILLA</country-name>
                                <code>AI</code>
                            </country>
                            <country>
                                <country-name>ANTARCTICA</country-name>
                                <code>AQ</code>
                            </country>
                        </countrylist>
                    </xf:instance>
                </xf:model>
            </div>

            <xf:group appearance="full" ref="items">
                <xf:label>XForms Select1 Control</xf:label>

                <xf:select1 id="select1" ref="item[1]" incremental="false">
                    <xf:label>appearance = 'minimal'</xf:label>
                    <xf:hint>This is a standard select1 control</xf:hint>

                    <xf:help>Not much to say here but some basic html formatting
                        is <b>possible</b></xf:help>
                    <xf:alert>The select value is not valid</xf:alert>
                    <xf:itemset nodeset="instance('codes')/country">
                        <xf:label ref="country-name"/>
                        <xf:value ref="code"/>
                    </xf:itemset>
                </xf:select1>

                <xf:select1 id="select2" ref="item[2]" appearance="compact"
                            incremental="false">
                    <xf:label>appearance = 'compact'</xf:label>
                    <xf:hint>This is a standard select1 control</xf:hint>

                    <xf:help>Not much to say here but some basic html formatting
                        is <b>possible</b></xf:help>
                    <xf:alert>The input value is not valid</xf:alert>
                    <xf:itemset nodeset="instance('codes')/country">
                        <xf:label ref="country-name"/>
                        <xf:value ref="code"/>
                    </xf:itemset>
                </xf:select1>

                <xf:select1 id="select3" ref="item[3]" appearance="full" incremental="false">
                    <xf:label>appearance = 'full'</xf:label>
                    <xf:hint>This is a standard select1 control</xf:hint>
                    <xf:help>Not much to say here but some basic html formatting
                        is <b>possible</b></xf:help>
                    <xf:alert>The input value is not valid</xf:alert>

                    <xf:itemset nodeset="instance('codes')/country">
                        <xf:label ref="country-name"/>
                        <xf:value ref="code"/>
                    </xf:itemset>
                </xf:select1>

<!--
                <xf:select1 id="select4" ref="item[4]" selection="open" appearance="minimal">
                    <xf:label>select1 (appearance='minimal', selection='open')</xf:label>
                    <xf:hint>selection open (does not work with itemsets yet)</xf:hint>
                    <xf:help>selection open (does not work with itemsets yet)</xf:help>
                    <xf:alert>The input value is not valid</xf:alert>

                    <xf:choices>
                        <xf:label>Red colors</xf:label>
                        <xf:item>
                            <xf:label>Red</xf:label>
                            <xf:value>r</xf:value>
                        </xf:item>
                        <xf:item>
                            <xf:label>Magenta</xf:label>
                            <xf:value>m</xf:value>
                        </xf:item>
                    </xf:choices>
                    <xf:choices>
                        <xf:label>Green colors</xf:label>
                        <xf:item>
                            <xf:label>Darkgreen</xf:label>
                            <xf:value>d</xf:value>
                        </xf:item>
                        <xf:item>
                            <xf:label>Lightgreen</xf:label>
                            <xf:value>l</xf:value>
                        </xf:item>
                    </xf:choices>
                </xf:select1>
-->
            </xf:group>
        </div>

        <br/>
        <br/>
        <xf:group id="mips" appearance="full" ref="/data">
            <xf:label>Model Item Property Tests</xf:label>
            <!-- valid -->
            <xf:trigger ref="@constraint[boolean-from-string(.)]">
                <xf:label>set all controls to invalid</xf:label>
                <xf:action>
                    <xf:setvalue ref="." value="'false'"/>
                </xf:action>
            </xf:trigger>
            <xf:trigger ref="@constraint[not(boolean-from-string(.))]">
                <xf:label>set all controls to valid</xf:label>
                <xf:action>
                    <xf:setvalue ref="." value="'true'"/>
                </xf:action>
            </xf:trigger>

            <!-- readonly -->
            <xf:trigger ref="@readonly[not(boolean-from-string(.))]">
                <xf:label>set all controls to readonly</xf:label>
                <xf:action>
                    <xf:setvalue ref="." value="'true'"/>
                </xf:action>
            </xf:trigger>
            <xf:trigger ref="@readonly[boolean-from-string(.)]">
                <xf:label>set all controls to readwrite</xf:label>
                <xf:action>
                    <xf:setvalue ref="." value="'false'"/>
                </xf:action>
            </xf:trigger>

            <!-- required -->
            <xf:trigger ref="@required[not(boolean-from-string(.))]">
                <xf:label>set all controls to required</xf:label>
                <xf:action>
                    <xf:setvalue ref="." value="'true'"/>
                </xf:action>
            </xf:trigger>
            <xf:trigger ref="@required[boolean-from-string(.)]">
                <xf:label>set all controls to optional</xf:label>
                <xf:action>
                    <xf:setvalue ref="." value="'false'"/>
                </xf:action>
            </xf:trigger>

            <!-- relevant -->
            <xf:trigger ref="@relevant[boolean-from-string(.)]">
                <xf:label>set all controls to non-relevant</xf:label>
                <xf:action>
                    <xf:setvalue ref="." value="'false'"/>
                </xf:action>
            </xf:trigger>
            <xf:trigger ref="@relevant[not(boolean-from-string(.))]">
                <xf:label>set all controls to relevant</xf:label>
                <xf:action>
                    <xf:setvalue ref="." value="'true'"/>
                </xf:action>
            </xf:trigger>
        </xf:group>
    </body>
</html>
